<%@Page Language="VB" %>
<%@Import Namespace="System.Web.Security" %>
<html>
<head>
<title>Login Form</title>
<style type="text/css">
body, input {font-family:Tahoma,Arial,sans-serif; font-size:10pt }
</style>
</head>
<body>
<form runat="server">
  UserName: <input id="txtUsr" type="text" runat="server" /><p />
  Password: <input id="txtPwd" type="password" runat="server" /><p />
  <ASP:CheckBox id="chkPersist" runat="server" />
  Remember my credentials<p />
  <input type="submit" value="Login" runat="server" onserverclick="DoLogin" /><p />
  <div id="outMessage" runat="server" />
</form>
</body>
</html>

<script language="VB" runat="server">
Sub DoLogin(objSender As Object, objArgs As EventArgs)

  If FormsAuthentication.Authenticate(txtUsr.Value, txtPwd.Value) Then
     FormsAuthentication.RedirectFromLoginPage(txtUsr.Value, chkPersist.Checked)
  Else
     outMessage.InnerHtml = "<b>Invalid credentials</b> please re-enter..."
  End If

End Sub
</script>
